import { close, connect } from "../util/mongo"



export const insertOne = async (tech) =>{
    const {db,client} = await connect()
    const collection = db.collection('step')
    const data = {
        name:tech.name,
        price:tech.price,
        equipment:tech.equipment
    }
    await collection.insertOne(data)
    close(client)
}
const insertAll = (collection ,docs) =>{

}
const getOne = (collection ,id) =>{

}
export const getAll = async( ) =>{
    const {db,client} = await connect()
    const collection = db.collection('step')
    const res = await collection.find().toArray()
    close(client)
    return res
}
const updateOne = (collection ,doc) =>{

}
const updateAll = (collection ,docs) =>{

}
const detete = (collection ,id) =>{

}
const deleteAll = (collection ,ids) =>{

}

